#include <iostream>
using std::cout;
using std::endl;

//可以将bool类型转换成整型
void test(){
    int x = true;// 1
    int y = false;// 0
    cout << x << ":" << y << endl;
}
//也可以将整型转换成bool类型
//非0-----》true   0-----》false
//-1=======》true
void bool_func(bool b){
    if(b){
        cout <<"true" << endl;
    }else {
        cout <<"false" << endl;
    }
}

void test2(){
    bool b1 = -100;
    bool b2 = 100;
    bool b3 = 0;
    bool b4 = 1;
    bool b5 = true;
    bool b6 = false;
    bool_func(b1);
    bool_func(b2);
    bool_func(b3);
    bool_func(b4);
    bool_func(b5);
    bool_func(b6);
}

void test3(){
    cout << sizeof(bool) << endl;
}

int main()
{
    test3();
    return 0;
}

